<?php
use \PsiFramework\Classes\Util\UI\Printer;
use \PsiFramework\Classes\Util\UI\HTML;
use \PsiFramework\Classes\Util\Log\Logger;
use \PsiFramework\Classes\Exceptions\SecurityException;

$responseId = $response->getAttribute("object");
$objectType = $response->getAttribute("objectType");

if (is_null($responseId)) {
    throw new SecurityException('You can\'t create a Response !');
}
?>
<form
    class="editForm"
    method="POST"
    action="<?php Printer::display(HTML::linkHref('action=CMS.Save&type='.$objectType));?>">
    <input type="hidden" name="id"
        value="<?php Printer::display($responseId->getId()); ?>" />
    <div class="label">
        <span class="titre"><?php Printer::display($responseId->getEntry()); ?></span>
    </div>
    <div class="label">
        <span class="titre"><?php Printer::display($responseId->getTheme()); ?></span>
    </div>
    <div class="label">
        <span class="titre">Payé</span>
        <input type="checkbox" name="paid" <?php if ($responseId->isPaid()) { echo 'checked="checked"'; } ?> />
    </div>
    <div class="label">
        <span class="titre">Echéance (jj/mm/aaaa)</span>
        <input type="text" name="expirationDate" value="<?php if (!is_null($responseId->getExpirationDate())) { Printer::display($responseId->getExpirationDate()->toString()); } ?>" />
    </div>
    <input type="submit" value="OK" />
</form>
